home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-06-25 | 524 b | 27 lines | [TEXT/CWIE] |
- typedef struct {
- short firstInstruction;
- UniversalProcPtr origFunction;
- } ptch, *ptchPtr, **ptchHdl;
-
-
- void main (void)
- {
- THz origZone;
- Handle ptchRes;
- UniversalProcPtr newPatch;
-
- origZone = GetZone();
- SetZone (SystemZone());
-
- ptchRes = Get1Resource ('PTCH', 128);
- if (ptchRes)
- {
- DetachResource (ptchRes);
-
- (*(ptchHdl)ptchRes)->origFunction = NGetTrapAddress (_PrGlue, ToolTrap);
- NSetTrapAddress ((ProcPtr)&(*(ptchHdl)ptchRes)->firstInstruction, _PrGlue, ToolTrap);
- }
-
- SetZone (origZone);
- }
-